import { Allow, IsString, Length } from 'class-validator';
import { CommonColumnEntity } from '../../../../util/entity/common.column.entity';

export class CreateUserDto extends CommonColumnEntity {
  @IsString({ message: '用户名不能为空' })
  @Length(3, 50, { message: '用户名不能少于3位' })
  username: string;

  @IsString({ message: '密码不能为空' })
  @Length(6, 100, { message: '密码不能少于6位' })
  password: string;

  @Allow()
  nickname?: string;

  @Allow()
  gender?: number;

  @Allow()
  avatar?: string;

  @Allow()
  email?: string;
}
